import { useLottie } from "lottie-react";
import PropTypes from "prop-types";
export default function LottieLine({ options, styles }) {
  const { View } = useLottie(
    { ...LottieLine.defaultProps.options, ...options },
    { ...LottieLine.defaultProps.styles, ...styles }
  );
  return <>{View}</>;
}

LottieLine.propTypes = {
  options: PropTypes.shape({
    autoplay: PropTypes.bool.isRequired,
    loop: PropTypes.bool,
    animationData: PropTypes.object.isRequired,
  }).isRequired,
  styles: PropTypes.shape({
    height: PropTypes.number.isRequired,
    position: PropTypes.string.isRequired,
  }).isRequired,
};

LottieLine.defaultProps = {
  options: { autoplay: true, loop: false, animationData: "" },
  styles: { height: 500, position: "" },
};
